package com.u.social.article.service;

import com.u.social.article.entity.Articles;
import com.baomidou.mybatisplus.extension.service.IService;
import com.u.social.article.model.ArticleWithTopicDTO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Alex Wu
 * @since 2025-01-23
 */
public interface IArticlesService extends IService<Articles> {

    @Transactional(rollbackFor = Exception.class)
    ArticleWithTopicDTO saveWithTopic(ArticleWithTopicDTO articleWithTopicDTO);

    Long asyncSaveArticle(ArticleWithTopicDTO articleWithTopicDTO);

    Boolean loadPublicResult(Long id);

    @Transactional(rollbackFor = Exception.class)
    Boolean updateWithTopic(ArticleWithTopicDTO articleWithTopicDTO);

    List<ArticleWithTopicDTO> getMineList(Long userId);

    Boolean softDelete(Long id);

    List<Articles> findHotArticles(long start, long end);

    List<Articles> findRecommendArticles(long userId, long start, long end);
}
